<top-title title="提报列表" icon="am-icon-user" mh-click=""></top-title>
<!--新增工程提报-->
<div class="am-padding-sm">
  <h3>{{projectTitle}}</h3>

  <form class="am-form am-form-horizontal am-text-sm" novalidate name="projectAddForm">
    <!-- 表单项-->
    <div ng-repeat="material in materials">
      <div class="am-form-group">
        <label class="am-u-sm-3 am-form-label mh-padding-none" for="{{::material.id}}">{{::material.name}}</label>

        <div class="am-u-sm-8 mh-padding-none">
          <input type="text" id="{{::material.id}}" class="am-input-sm am-radius am-form-field"
                 style="background-color: #ebebeb;border:0;" ng-model="material.actual" required>
        </div>
        <div class="am-u-sm-1" style="padding: 0.6rem 0 0.6rem 0.3rem;">
          <strong>{{::material.unit}}</strong>
        </div>
      </div>
      <!-- 如果当前是精品植物，则显示下边的内容-->
      <div ng-if="material.classid==='精品植物'">
        <div class="am-form-group">
          <label class="am-u-sm-3 am-form-label mh-padding-none" for="died">已死苗木：</label>

          <div class="am-u-sm-8 mh-padding-none">
            <input type="number" id="died" class="am-input-sm am-radius am-form-field"
                   style="background-color: #ebebeb;border:0;" ng-model="material.died" required>
          </div>
          <div class="am-u-sm-1" style="padding: 0.6rem 0 0.6rem 0.3rem;">
            <strong>株</strong>
          </div>
        </div>
        <div class="am-form-group">
          <!--form带单位的水平布局-->
          <label class="am-u-sm-3 am-form-label mh-padding-none" for="dying">半死苗木：</label>

          <div class="am-u-sm-8 mh-padding-none">
            <input type="number" id="dying" class="am-input-sm am-radius am-form-field"
                   style="background-color: #ebebeb;border:0;" ng-model="material.dying" required>
          </div>
          <div class="am-u-sm-1" style="padding: 0.6rem 0 0.6rem 0.3rem;">
            <strong>株</strong>
          </div>
        </div>
        <div class="am-form-group">
          <!--form带单位的水平布局-->
          <label class="am-u-sm-3 am-form-label mh-padding-none" for="add">补苗：</label>

          <div class="am-u-sm-8 mh-padding-none">
            <input type="number" id="add" class="am-input-sm am-radius am-form-field"
                   style="background-color: #ebebeb;border:0;" ng-model="material.add" required>
          </div>
          <div class="am-u-sm-1" style="padding: 0.6rem 0 0.6rem 0.3rem;">
            <strong>株</strong>
          </div>
        </div>
        <div class="am-form-group">
          <!--form带单位的水平布局-->
          <label class="am-u-sm-3 am-form-label mh-padding-none" for="added">已换苗木：</label>

          <div class="am-u-sm-8 mh-padding-none">
            <input type="number" id="added" class="am-input-sm am-radius am-form-field"
                   style="background-color: #ebebeb;border:0;" ng-model="material.added" required>
          </div>
          <div class="am-u-sm-1" style="padding: 0.6rem 0 0.6rem 0.3rem;">
            <strong>株</strong>
          </div>
        </div>
        <div class="am-form-group">
          <label class="am-form-label mh-padding-none">说明：</label>
          <textarea class="am-form-field am-radius" style="background-color: #ebebeb;border:0;"
                    ng-model="material.description"></textarea>
        </div>
      </div>
    </div>
    <span ng-show="projectAddForm.$invalid" class="am-text-danger am-text-center am-text-sm">表单有未填写的数据，请检查</span>
    <button class="am-btn am-btn-default am-btn-block am-radius mh-lightgreen mh-text-white"
            ng-disabled="projectAddForm.$invalid"
            ng-click="submit(materials)">提交
    </button>

      <div class="am-text-center am-padding-vertical">
      <a ng-href="#/tempplanAdd"
         class="am-btn am-btn-default mh-lightgreen mh-text-white am-radius am-padding-horizontal-xl am-margin-right-xs">
          创建计划
      </a>
      <button class="am-btn am-btn-default mh-lightgreen mh-text-white am-radius am-padding-horizontal-xl am-margin-right-xs"
              ng-click="delmode(materials)">删除模块
      </button>
      </div>
  </form>
</div>
